﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NullObject
{
    public class StudentFactory
    {
        string[] list = { "yuanloo", "ming", "Lily" };
        public Student GetStudent(string name)
        {
            foreach (var item in list)
            {
                if (item.Equals(name))
                {
                    return new RealStudent(item);
                }
            }
            return new NullStudent();
        }
    }
}
